using System;
using System.IO;

namespace AsposeQuickStart
{
    //method to set all th licenses for Aspose products
    public static class AsposeLicense
    {

        public static bool SetLicense()
        {
           //path to the license file - set according to your license file location
            string totalLicense = @"c:\data\license\Aspose.Total.lic";

            try
            {
                
                Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
                pdfLicense.SetLicense(totalLicense);

                Aspose.Words.License wordsLicense = new Aspose.Words.License();
                wordsLicense.SetLicense(totalLicense);

                Aspose.Cells.License cellsLicense = new Aspose.Cells.License();
                cellsLicense.SetLicense(totalLicense);

                Aspose.Tasks.License tasksLicense = new Aspose.Tasks.License();
                tasksLicense.SetLicense(totalLicense);

                Aspose.Slides.License slidesLicense = new Aspose.Slides.License();
                slidesLicense.SetLicense(totalLicense);

                Aspose.BarCode.License barcodeLicense = new Aspose.BarCode.License();
                barcodeLicense.SetLicense(totalLicense);

                Aspose.BarCodeRecognition.License recognitionLicense = new Aspose.BarCodeRecognition.License();
                recognitionLicense.SetLicense(totalLicense);

                return true;
            }
            catch(Exception ex)
            {
                Settings.LogException(ex);   
                return false;
            }
        }
        
    }
}
